/* 基础重置与全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    padding-top: 80px; /* 为悬浮框架留出空间 */
}

/* 悬浮框架样式 - 优化了响应式 */
.floating-frame {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    padding: 15px 5%; /* 使用百分比内边距更响应式 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* 允许在小屏幕换行 */
}

.floating-frame h1 {
    font-size: clamp(1.2rem, 3vw, 1.5rem); /* 响应式字体 */
    margin: 0;
    color: white;
}

.stats-container {
    display: flex;
    gap: 10px; /* 减小间隙适应小屏幕 */
    font-size: 0.9rem;
    flex-wrap: wrap; /* 允许统计项换行 */
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 12px; /* 减小内边距 */
    border-radius: 20px;
    display: flex;
    align-items: center;
    margin-top: 5px; /* 添加顶部间距 */
}

.stat-item .icon {
    margin-right: 6px;
    font-size: 1.1rem;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e1e4e8;
    margin-bottom: 30px;
    flex-wrap: wrap; /* 允许小屏幕换行 */
}

h1 {
    color: #2c3e50;
    font-size: clamp(1.8rem, 4vw, 2.2rem); /* 响应式字体 */
    margin-bottom: 15px;
}

h2 {
    color: #3498db;
    font-size: clamp(1.5rem, 3vw, 1.8rem); /* 响应式字体 */
    margin: 20px 0 12px;
}

/* 列表样式 */
ul {
    list-style: none;
    margin: 20px 0;
}

li {
    background: white;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

li:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 链接和按钮样式 */
a {
    text-decoration: none;
    color: #27ae60;
    font-weight: 500;
    display: inline-block;
    margin-right: 15px;
}

a:hover {
    color: #2ecc71;
    text-decoration: underline;
}

.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s; /* 添加所有属性过渡 */
    transform: translateY(0); /* 初始位置 */
}

.btn:hover {
    background: #2980b9;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-vote {
    background: #27ae60;
}

.btn-vote:hover {
    background: #219653;
}

/* 表单样式 */
form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

fieldset {
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    padding: 0 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.2rem;
}

/* 单选按钮样式 */
.radio-group {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

label {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background 0.2s;
}

label:hover {
    background: #e9ecef;
}

/* 错误消息 */
.error-message {
    color: #e74c3c;
    background: #fadbd8;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 500;
}

/* 结果页样式 - 修复进度条问题 */
.results-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.vote-item {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.vote-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.vote-label {
    font-weight: 500;
    font-size: 1.1rem;
    color: #2c3e50;
}

.vote-count {
    font-weight: bold;
    color: #3498db;
    font-size: 1.1rem;
    background: #f1f8ff;
    padding: 4px 12px;
    border-radius: 12px;
}

/* 修复进度条显示问题 */
.progress-container {
    position: relative;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 20px; /* 进度条的总高度 */
    background-color: #ccc; /* 进度条的背景色 */
    border-radius: 5px; /* 圆角效果 */
    overflow: hidden; /* 隐藏超出部分的子元素 */
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}
/* 百分比标签 */
.percentage-label {
    position: absolute;
    right: 10px;
    top: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 20px;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e1e4e8;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 操作按钮容器 */
.action-buttons {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* 允许小屏幕换行 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    body {
        padding: 70px 15px 20px; /* 调整顶部内边距 */
    }
    
    .floating-frame {
        padding: 12px 5%;
    }
    
    .stats-container {
        gap: 8px;
        font-size: 0.85rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    form {
        padding: 20px 15px;
    }
    .vote-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .vote-count {
        align-self: flex-end;
    }
}

li a {
    color: green;
}